//
//  CHSLayerAppearanceController.m
//  ZXAnimationUtil_Example
//
//  Created by 朱新明 on 2023/9/11.
//  Copyright © 2023 simon. All rights reserved.
//

#import "CHSLayerAppearanceController.h"
#import <ZXCategoriesUtil/CAICategories.h>

@interface CHSLayerAppearanceController ()

@end

@implementation CHSLayerAppearanceController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"设置图层外观";
    self.view.backgroundColor = [UIColor whiteColor];
    [self maskBounds];
}


- (void)maskBounds{
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(20, 100, 100, 100)];
    view.layer.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.5].CGColor;
    view.tag = 100;
    [self.view addSubview:view];
    
//    view.layer.masksToBounds = YES;
//    view.layer.cornerRadius = 20;
//    view.layer.borderWidth = 1;
    [view zx_setBorderWithWithCornerRadius:10 boundsSize:CGSizeMake(100, 100) roundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight topBorder:YES leftBorder:YES bottomBorder:NO rightBorder:YES borderWidth:1 borderColor:[UIColor blackColor]];
}




- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
//    int a = (int)UIScreen.mainScreen.bounds.size.width-100;
//    self.layer.frame = CGRectMake(arc4random() % a, 0, 100, 100);
    
//    [UIView animateWithDuration:0.25 animations:^{
//          //动画动作被重新应用
//    }];
    
    UIView *view = [self.view viewWithTag:100];
    view.frame = CGRectMake(20, 100, 100, 200);

    [view zx_setBorderWithWithCornerRadius:10 boundsSize:CGSizeMake(100, 200) roundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRight topBorder:NO leftBorder:YES bottomBorder:YES rightBorder:YES borderWidth:1 borderColor:[UIColor blackColor]];
}




/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
